/*  Marx libvlc 0.9.0 Wrapper v0.0.2 - Alpha Release
    
    
    Copyright (C) 2008  Marx Bitware <support@marxbitware.com>

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 */

using System;
using System.Runtime.InteropServices;
using System.IO;

namespace Marx_libvlc_wrapper
{

    public struct libvlc_exception_struct
    {
        private int b_raised;
        private int i_code;
        private string psz_message;
    }

    public class Marx_libvlc_exception
    {
        #region Constructor

        public Marx_libvlc_exception(ref libvlc_exception_struct ex)
        {
            init(ref ex);
        }

        #endregion

        #region Methods

        public void init(ref libvlc_exception_struct ex)
        {
            libvlc_exception_init(ref ex);
        }

        public int raised(ref libvlc_exception_struct ex)
        {
            return libvlc_exception_raised(ref ex);
        }

        public void raise(ref libvlc_exception_struct ex, string format)
        {
            libvlc_exception_raise(ref ex, format);
        }

        public void clear(ref libvlc_exception_struct ex)
        {
            libvlc_exception_clear(ref ex);
        }

        public string get_message(ref libvlc_exception_struct ex)
        {
            return libvlc_exception_get_message(ref ex);
        }

        #endregion

        #region DLL Import

        [DllImport("libvlc")]
        private static extern void libvlc_exception_init (ref libvlc_exception_struct ex);

        [DllImport("libvlc")]
        private static extern int libvlc_exception_raised (ref libvlc_exception_struct ex);

        [DllImport("libvlc")]
        private static extern void libvlc_exception_raise (ref libvlc_exception_struct ex, string format);

        [DllImport("libvlc")]
        private static extern void libvlc_exception_clear (ref libvlc_exception_struct ex);

        [DllImport("libvlc")]
        private static extern string libvlc_exception_get_message(ref libvlc_exception_struct ex);

        #endregion
    }
}
